/**
 * Created by zzy on 2017/10/20.
 */
import {observer} from "mobx-react";
import {observable, action, computed, observe} from 'mobx'

class MeInfoStore{
    @observable phoneNum='';
    @observable userName='游客';
    @observable userIconUrl='';
    @observable userWaterTicketCount=0;
    @observable huibeiCode='';
    constructor(){
    }
    @action setUserInfo(userInfo){
        LOG('userInfo------------'+JSON.stringify(userInfo));
        this.phoneNum=userInfo.phoneNum;
        this.userName=userInfo.userName;
        this.userIconUrl=userInfo.userIconUrl;
        this.userWaterTicketCount=userInfo.userWaterTicketCount;
        this.huibeiCode=userInfo.huibeiCode;
    }
    @computed get userInfo(){
        LOG('userInfo------------');
        return {
            phoneNum:this.phoneNum,
            userName:this.userName,
            userIconUrl:this.userIconUrl,
            userWaterTicketCount:this.userWaterTicketCount,
        };
    }
    @action setUserIcon(icon){
        this.userIconUrl=icon
    }
}
let meInfoStore=new MeInfoStore();
export default meInfoStore;